 <template>
  <el-table ref="singleTable" 
    :data="reset" 
    border
    @selection-change="handleSelectionChange"
    style="width: 100%" 
    :header-cell-style="{background:'#f4f4f4'}">    
    <el-table-column fixed type="selection" width="55" align="center"></el-table-column>
    <el-table-column 
    type="index"
    label="序号"
    align="center"
    width="55">
    </el-table-column>
    <el-table-column prop="Code" label="设备编码" align="center"></el-table-column>
    <el-table-column prop="Name" label="设备名称" align="center"></el-table-column>
    <!-- <el-table-column prop="Belong" label="所属线体"></el-table-column> -->
    <el-table-column prop="FilePath" label="文件路径" :show-overflow-tooltip="true" align="center"></el-table-column>
    <el-table-column 
      prop="DeviceType" 
      :show-overflow-tooltip="true"
      :formatter="format" 
      label="类型" 
      align="center">
    </el-table-column>
    <el-table-column prop="IsEnableFormat" label="状态" align="center"></el-table-column>
    <el-table-column 
      prop="WorkStationName" 
      label="所属工位" 
      align="center"
      :show-overflow-tooltip="true">
    </el-table-column> 
    <el-table-column prop="ServiceTag" label="机器序列" align="center"></el-table-column>
    <el-table-column prop="CreateByFormat" label="创建人" align="center"></el-table-column>
    <el-table-column prop="CreateTime" label="创建时间" :show-overflow-tooltip="true" align="center"></el-table-column>
    <el-table-column prop="LastModifyByFormat" label="修改人" :show-overflow-tooltip="true" align="center"></el-table-column>
    <el-table-column prop="LastModifyTime" label="修改时间" :show-overflow-tooltip="true" align="center"></el-table-column>
  </el-table>
</template>

  <script>
export default {
  props:{
    reset:{
      type:Array
    }
  },
  data() {
    return {
      
    };
  },
  methods:{
    handleSelectionChange(val){
      this.$emit('changeData',val)
      let listId=[]
      val.forEach(el => {
        listId.push(el.DeviceId)
      });
      this.$emit('getId',listId)          
    },
    format(row, column, cellValue, index){
      if(row.DeviceType==0){
        return '未知设备'
      }else{
        return '印刷输出设备'
      }
    }
  }
};
</script>